#include "catch.hpp"

#include "common/uuid.h"
#include "common/log.h"


TEST_CASE("uuid tests", "[uuid]") {
    using namespace std;
    using namespace evm;

    uuid u;
    log_info("{}", string(u));
    string s = u;
    REQUIRE(s.size() == 36);

    auto u1 = u;
    REQUIRE(u1 == u);
    REQUIRE(string(u1) == string(u));

    REQUIRE(u != uuid());
    REQUIRE(u != uuid::to_str());

    REQUIRE(!uuid::is_valid("invalid"));

    REQUIRE_THROWS(uuid("invalid"));
}
